
pd<-paste(wd, "/Figures/Figures_Output/",sep="")



res_nocv<-read.csv(file="resultsK0.csv")




pdf(file=paste(pd,"great_depression_plot_1.pdf",sep=""), 6, 6)


par(mfrow=c(1,1))

par(mar=c(3,4,3,1))


plot(res_nocv$years,res_nocv$pD_hat,type="n",lwd=2,col="Dark Blue",axes=F,ylim=c(.25,.575),xlab="",ylab="% World Democracies",xlim=c(1950,2013))


grid()

polygon(c(2000,2012,2012,2000),c(.22,.22,.6,.6),col=rgb(.1,.1,.1,.1),border="NA")




lines(res_nocv$years[res_nocv$years < 2001],res_nocv$pD_hat[res_nocv$years < 2001],lwd=2,col="Dark Blue")

lines(res_nocv$years[res_nocv$years >= 2001],res_nocv$pD_hat[res_nocv$years >= 2001],lwd=2,lty=2,col="Dark Blue")





lines(res_nocv$years,res_nocv$pD,lwd=2,col=rgb(.1,.1,.1,.75))




axis(1);axis(2,at=seq(0,1,by=.05),labels=(seq(0,100,by=5)))


res_gd<-read.csv(file="great_depression.csv")


lines(res_gd[,1],res_gd$ls_autoc, lwd=2,col=rgb(.5,.1,.5,1),lty=2)




lines(res_gd[,1],res_gd$sd_autoc, lwd=2,col=rgb(.1,.5,.1,1),lty=2)





#text(2006,.26,"Out of",cex=1)
#text(2006,.25,"Sample",cex=1)

#text(1993,.25,"In Sample",cex=1)


text(1989.5,.51,"True Value",cex=.75)


text(1955,.33,"Model Prediction",cex=.75)

text(2003.75,.47,"Long-Shallow",cex=.75)


text(2010,.51,"Short-Deep",cex=.75)

#text(2006.5,.475,"Deep",cex=1)


#text(1997.75,.46,"Great",cex=1)
#text(2000.5,.45,"Depression",cex=1)
#text(2002,.44,"Counterfactual",cex=1)

mtext("Global Economic Depression",font=2,line=1,cex=1.75)
mtext("Autocratic Bias",font=3,line=0,cex=1.25)


dev.off()


###################################################






pdf(file=paste(pd,"great_depression_plot_2.pdf",sep=""), 6, 6)





par(mar=c(3,4,3,1))


plot(res_nocv$years,res_nocv$pD_hat,type="n",lwd=2,col="Dark Blue",axes=F,ylim=c(.25,.575),xlab="",ylab="% World Democracies",xlim=c(1950,2013))


grid()

polygon(c(2000,2012,2012,2000),c(.22,.22,.6,.6),col=rgb(.1,.1,.1,.1),border="NA")




lines(res_nocv$years[res_nocv$years < 2001],res_nocv$pD_hat[res_nocv$years < 2001],lwd=2,col="Dark Blue")

lines(res_nocv$years[res_nocv$years >= 2001],res_nocv$pD_hat[res_nocv$years >= 2001],lwd=2,lty=2,col="Dark Blue")





lines(res_nocv$years,res_nocv$pD,lwd=2,col=rgb(.1,.1,.1,.75))




axis(1);axis(2,at=seq(0,1,by=.05),labels=(seq(0,100,by=5)))


res_gd<-read.csv(file="great_depression.csv")


lines(res_gd[,1],res_gd$ls_democ, lwd=2,col=rgb(.5,.1,.5,1),lty=2)




lines(res_gd[,1],res_gd$sd_democ, lwd=2,col=rgb(.1,.5,.1,1),lty=2)





#text(2006,.26,"Out of",cex=1)
#text(2006,.25,"Sample",cex=1)

#text(1993,.25,"In Sample",cex=1)




mtext("Global Economic Depression",font=2,line=1,cex=1.75)
mtext("Democratic Bias",font=3,line=0,cex=1.25)


dev.off()

